@extends('web.frame_layout')
<link rel="stylesheet" href="{{asset('web/css/withdrawal-record.css')}}">
<?php $parent_menu = "财务中心"; $menu_selected = "提现记录";?>
<style>
    .detail {
        width: 100%;
        border: none;
        font-size: 14px;
        border-collapse: separate;
        border-spacing: 15px
    }

    .detail tr {
        margin: 30px 0;
    }

    .detail tr td:first-child {
        text-align: right;
        padding-right: 10px;
    }

    .yjj {
        background: red!important;
    }

    .ydk {
        background: green!important;
    }
</style>
@section('content')
    <div class="m-right-nr">
        <div>
            <h2><span>{{$menu_selected}}</span></h2>
        </div>
        <div class="m-txList">
            <div class="m-txList-title">
                <form action="{{route('web.withdraw.log')}}" action="get" id="txjl_search">
                    <select name="type">
                        <option value="1" selected>申请单号搜索</option>
                        {{--<option value="2">用户名搜索</option>--}}
                    </select>
                    <div>
                        <input type="text" name="search" placeholder="请输入编号进行精准查询">
                        <button>搜索</button>
                    </div>
                </form>
            </div>
            <div class="table-responsive">
                <table class="table">
                    <tr>
                        <th>申请单号</th>
                        <th>钱包类型</th>
                        <th>提现金额</th>
                        <th>提现手续费</th>
                        <th>实际到账</th>
                        <th>信息备注</th>
                        <th>提现方式</th>
                        <th>状态</th>
                        <th>提现日期</th>
                        <th>操作</th>
                    </tr>
                    @foreach($withdrawLogs as $log)
                        <tr>
                            <td>{{ $log->no }}</td>
                            <td>{{ uWalletStr($log->wallet) }}</td>
                            <td>{{ $log->money }}</td>
                            <td>{{ $log->tax_money }}</td>
                            <td>{{ $log->ok_money }}</td>
                            <td>{{ $log->remark == '' ? '无' : $log->remark }}</td>
                            <td>{{uPayWayStr($log->type)}}</td>
                            <td>
                                @if($log->status == \App\Models\MWithdrawLog::$STATUS_WAIT)
                                    <a href="###" class="shz">审核中</a>
                                @elseif($log->status == \App\Models\MWithdrawLog::$STATUS_SUCCESS)
                                    <a href="###" class="ydk">已打款</a>
                                @elseif($log->status == \App\Models\MWithdrawLog::$STATUS_DENY)
                                    <a href="###" class="yjj">已拒绝</a>
                                @endif
                            </td>

                            <td>{{ date("Y-m-d H:i:s",$log->create_time) }}</td>
                            <td>
                                <a href="###" onclick="withdrawDlg({{$log}})">查看</a>&nbsp;
                                @if($log->status==\App\Models\MWithdrawLog::$STATUS_WAIT)
                                    <a href="###" class="cancel" data="{{$log->id}}" style="background: red;">取消</a>
                                @endif
                            </td>
                        </tr>
                    @endforeach

                </table>
                @include('web.coms.fenye')
            </div>
        </div>
    </div>
    @include('web.coms.withdraw-dialog')



@endsection

@section('footer')
    <script type="text/javascript">
        //取消提现申请
        $('.cancel').on('touchend click', function (e) {
            e.preventDefault();
            var id = $(this).attr('data');  //记录ID
            layer.open({
                skin: 'layui-layer-molv',
                title: "撤销提现申请",
                area: '300px',
                content: "你确定要撤销提现申请吗？",
                btn: ['确定', '取消'],
                btnAlign: 'c',
                yes: function (index) {
                    var url = "{{route('web.withdraw.cancel')}}" + "/" + id;
                    window.location.href = url;
                    layer.close(index);
                }
            });
        });
    </script>
@endsection